﻿#pragma once

#include <string>

enum class TagType : uint8_t {
	END,
	BYTE,
	SHORT,
	INT,
	LONG,
	FLOAT,
	DOUBLE,
	BYTE_ARRAY,
	STRING,
	LIST,
	COMPOUND,
	INT_ARRAY
};

class MojangsonToken_class {
private:
	int id{};
	std::u8string_view name{};
	char8_t symbol{};

public:
	constexpr MojangsonToken_class(int i, std::u8string_view n, char8_t sym) : id(i), name(n), symbol(sym) {}

	constexpr int getId() const {
		return id;
	}

	constexpr std::u8string getName() const {
		return std::u8string(name);
	}

	constexpr char8_t getSymbol() const {
		return symbol;
	}

	constexpr std::u8string_view toString_View() const {
		return name;
		// return String.valueOf(symbol);
	}
};

struct MojangsonToken {
	static constexpr MojangsonToken_class COMPOUND_START = MojangsonToken_class(0, u8"Compound_Start", u8'{');
	static constexpr MojangsonToken_class COMPOUND_END = MojangsonToken_class(1, u8"Compound_End", u8'}');
	static constexpr MojangsonToken_class ELEMENT_SEPERATOR = MojangsonToken_class(2, u8"Element_Seperator", u8',');
	static constexpr MojangsonToken_class ARRAY_START = MojangsonToken_class(3, u8"Array_Start", u8'[');
	static constexpr MojangsonToken_class ARRAY_END = MojangsonToken_class(4, u8"Array_End", u8']');
	static constexpr MojangsonToken_class ELEMENT_PAIR_SEPERATOR = MojangsonToken_class(5, u8"Pair_Seperator", u8':');
	static constexpr MojangsonToken_class STRING_QUOTES = MojangsonToken_class(6, u8"String_Quotes", u8'\"');
	static constexpr MojangsonToken_class DOUBLE_SUFFIX = MojangsonToken_class(8, u8"Double_Suffix", u8'd');
	static constexpr MojangsonToken_class BYTE_SUFFIX = MojangsonToken_class(9, u8"Byte_Suffix", u8'b');
	static constexpr MojangsonToken_class FLOAT_SUFFIX = MojangsonToken_class(10, u8"Float_Suffix", u8'f');
	static constexpr MojangsonToken_class SHORT_SUFFIX = MojangsonToken_class(11, u8"Short_Suffix", u8's');
	static constexpr MojangsonToken_class LONG_SUFFIX = MojangsonToken_class(12, u8"Long_Suffix", u8'l');
	static constexpr MojangsonToken_class WHITE_SPACE = MojangsonToken_class(13, u8"WhiteSpace", u8' ');
};
